package com.corticon.dialogs.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * DataValidationType entity.
 * 
 * @author Yanglifan
 */
@Entity
@Table(name = "qs_datavalidationtype")
public class DataValidationType implements java.io.Serializable {

    private String code;
    private String description;
    private String name;
    private Set<DataValidation> dataValidations = new HashSet<DataValidation>();

    public DataValidationType() {
    }

    @Id
    @Column(name = "code")
    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Column(name = "description", length = 256)
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "name", length = 256)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dataValidationType")
    public Set<DataValidation> getDataValidations() {
        return this.dataValidations;
    }

    public void setDataValidations(Set<DataValidation> dataValidations) {
        this.dataValidations = dataValidations;
    }
}